﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web.Mvc;
using System.Text;

using Mvc.XForms.UI.Settings;
using System.Web;

namespace Mvc.XForms.UI {
	public static class GridExtensions {
		public static GridSettings<T> Grid<T>(this HtmlHelper html, IPagedSortedList<T> pagedSorted) {
			var grid = new Grid<T>(html.ViewContext.HttpContext, pagedSorted);
			return grid.Settings;
		}

		public static GridSettings<T> Grid<T>(this HtmlHelper html, IPagedList<T> paged) {
			var grid = new Grid<T>(html.ViewContext.HttpContext, paged);
			return grid.Settings;
		}

		public static GridSettings<T> Grid<T>(this HtmlHelper html, ISortedList<T> sorted) {
			var grid = new Grid<T>(html.ViewContext.HttpContext, sorted);
			return grid.Settings;
		}

		public static GridSettings<T> Grid<T>(this HtmlHelper html, IEnumerable<T> items) {
			var grid = new Grid<T>(html.ViewContext.HttpContext, items);
			return grid.Settings;
		}

		public static GridSettings<T> Grid<T>(this HtmlHelper html, IEnumerable<T> items, IPaged paged) {
			var grid = new Grid<T>(html.ViewContext.HttpContext, items, paged);
			return grid.Settings;
		}

		public static GridSettings<T> Grid<T>(this HtmlHelper html, IEnumerable<T> items, ISorted sorted) {
			var grid = new Grid<T>(html.ViewContext.HttpContext, items, sorted);
			return grid.Settings;
		}

		public static GridSettings<T> Grid<T>(this HtmlHelper html, IEnumerable<T> items, IPaged paged, ISorted sorted) {
			var grid = new Grid<T>(html.ViewContext.HttpContext, items, paged, sorted);
			return grid.Settings;
		}

		public static GridSettings<T> Grid<T>(HttpContextBase context, IPagedSortedList<T> pagedSorted) {
			var grid = new Grid<T>(context, pagedSorted);
			return grid.Settings;
		}

		public static GridSettings<T> Grid<T>(HttpContextBase context, IPagedList<T> paged) {
			var grid = new Grid<T>(context, paged);
			return grid.Settings;
		}

		public static GridSettings<T> Grid<T>(HttpContextBase context, ISortedList<T> sorted) {
			var grid = new Grid<T>(context, sorted);
			return grid.Settings;
		}

		public static GridSettings<T> Grid<T>(HttpContextBase context, IEnumerable<T> items) {
			var grid = new Grid<T>(context, items);
			return grid.Settings;
		}

		public static GridSettings<T> Grid<T>(HttpContextBase context, IEnumerable<T> items, IPaged paged) {
			var grid = new Grid<T>(context, items, paged);
			return grid.Settings;
		}

		public static GridSettings<T> Grid<T>(HttpContextBase context, IEnumerable<T> items, ISorted sorted) {
			var grid = new Grid<T>(context, items, sorted);
			return grid.Settings;
		}

		public static GridSettings<T> Grid<T>(HttpContextBase context, IEnumerable<T> items, IPaged paged, ISorted sorted) {
			var grid = new Grid<T>(context, items, paged, sorted);
			return grid.Settings;
		}
	}
}
